package br.edu.ufcg.splab.util.commands;

import org.naturalcli.IParameterType;

public class CoverageCriteriaParameter implements IParameterType {
	private final String[] coverageCriteria = {"T", "P", "B"};
	
	/**
	 * {@inheritDoc}
	 */
	public String validationMessage(String value) {
		return this.validateParameter(value) ? null : value + " is not a valid coverage criterion.";
	}
	
	/**
	 * {@inheritDoc}
	 */
	public boolean validateParameter(String value) {
		for(String c:coverageCriteria){
			if(c.equals(value)){
				return true;
			}
		}
		return false;
	}
	
	/**
	 * {@inheritDoc}
	 */
	public String getParameterTypeName() {
		return "coveragecriteria";
	}
	
	/**
	 * {@inheritDoc}
	 */
	public Object convertParameterValue(String value) {
		return value;
	}

}